<template>
	<view>
		<u-navbar title="关于">
		</u-navbar>
		<view style="width: 100%;margin-top: 100rpx;" class="u-flex u-flex-col u-col-center">
			<image class="" style="width: 187rpx;height: 187rpx;border-radius: 50rpx;"
				src="../../static/logo.png"></image>
			<view class="u-m-t-20 u-font-xl">创业系统</view>
			<view class="text-gray u-font-md">{{version}}</view>
		</view>
		<u-button type="primary" class="u-m-30" @click="checkUpdate()">检查更新</u-button>
	</view>
</template>

<script>
	import checkUpdate from "@/uni_modules/uni-upgrade-center-app/utils/check-update";
	export default {
		onLoad() {
			plus.runtime.getProperty(plus.runtime.appid, (wgtInfo) => {
				this.version = wgtInfo.version
			})
		},
		data() {
			return {
				version: "1.0.0"
			}
		},
		methods: {
			async checkUpdate() {
				uni.showLoading({
					mask: true
				});
				checkUpdate().then(res => {
					if (res.result.code == 0)
						this.$toast("已是最新版本");
					uni.hideLoading()
				}).catch(err => {
					uni.hideLoading()
				});
			}
		}
	}
</script>

<style>

</style>
